const express = require('express');
const pool = require('../../pool.js');
const finish = express.Router();
finish.get('/finish', (req, res) => {
    let order_status = '已完成';
    if (req.query.oid) {
        pool.query('select * from orders where oid = ? and order_status = ?', [req.query.oid, order_status], (err, r) => {
            res.send(r);
        })
    } else {
        pool.query('select * from orders where  order_status = ?', [order_status], (err, r) => {
            res.send(r);
        })
    }
})
module.exports = finish;